<?php

class m_form_actions_block_front_FormEditAction extends m_backoffice_extends_BlockEditModal
{
	public function execute()
	{
		$this->setModalParameters();

        $website = $this->getWebsite();

        $forms = $this->getDocumentProvider()->loadDocuments('modules_form/structure')->whereIsEqual('websiteId', $website->getUniqueId())->retrieveDocuments($website->getLang());

        if($this->isFormSubmit())
        {
            $this->saveBlockAndClose();
        }

        $this->addToModel('forms', $forms);

		$this->setView('success');
	}	
}